home *** CD-ROM | disk | FTP | other *** search
/ Info-Mac 4 / Info_Mac IV CD-ROM (Pacific HiTech Inc.)(August 1994).iso / Development / General / ViewIt™ 2.24 Shareware / FaceWare / FaceWare.rsrc / TEXT_1315_BC5. Pop-Up Palettes.txt < prev    next >
Text File  |  1994-04-10  |  3KB  |  18 lines

  1. Pop-Up Palettes
  2.   Pop-up palettes are set up in the same way as static controls linked to resource lists or a resource range (described in "Icons, Picts, ..." topic), but are of type "List or Menu" and cannot be linked to an STR#.  If linked to clut 1310, the pop-up palette can be used as a "Color Picker" (see "Color Pickers" topic).
  3.  
  4. Operation
  5.   BaseCt displays a rectangular pop-up menu when the control is clicked.  The menu will have Max - Min + 1 cells (= # of items specified from list or in resource range), with each cell equal in size to the visible content area of the control (or 1/4 its size if > 64 items shown), and displaying the corresponding resource from the list or range.  The selection of an item from this pop-up menu results in resetting the control Value and redrawing the control.
  6.   The popped-up palette is made as square as possible to minimize the distance that the user must move the mouse to choose an item.  If the control's content area is wider than it is tall, then a rectangular palette is shown with its larger side in the vertical direction.  In all other cases a rectangular palette is shown with its larger side in the horizontal direction.
  7.   COLOR NOTE:  If linking a clut resource that contains colors other than the original 8 QuickDraw colors, make certain that the "Prefer Color Window" option is checked in the Window dialog so that ViewIt will create a color window when running on machines that support Color QuickDraw.
  8.  
  9. Options
  10.   In addition to the VarCode options described in the "Icons, Picts, ..." topic which affect the control, three options affect the appearance of the pop-up menu:
  11.   If 4 is added to VarCode, then the menu is popped up above the control, otherwise it appears below the control.
  12.   If 8 is added to VarCode, then the menu is popped up at the right or left edge of the control (instead of at its top or bottom edge).
  13.   If 32 is added to VarCode, then each resource in the pop-up menu will be drawn centered within its cell, otherwise it is aligned at the top, left of the cell but offset by an amount equal to the control's top and left indent (if any).
  14.  
  15. Data Linking
  16.   Data linking is based on the standard control value.  This makes it easy to use SetVal or SetCtlValue to flip from one resource to another, and GetVal or GetCtl to get the control's current value after it has been changed via the pop-up palette.  You can also retrieve a pattern from a PAT# list by using the control's value in the toolbox call GetIndPattern, or a color from a clut table by passing cResID and cValue (after calling GetCtl) to ViewIt's GetFgC:
  17.  FaceIt(nil,GetFgC,0,-1,cResID,cValue);
  18. where the color would be returned in uRGB.